<?php
	define('ROOT_PATH', dirname(__FILE__) . '/');
	
	$list = array("120nk","jznanke","jznkyy","szjznk","zsnkyy","zsrdnk");
	$key = array();
	foreach($list as $v){
		$contents = file_get_contents(ROOT_PATH.$v.".csv");
		$arr1 = explode("\n",$contents);
		foreach($arr1 as $k2 => $v2){
			$arr2 = explode(",",$v2);
			if (!empty($arr2[4])) $key[] = $arr2[4];
		}
		
		$str = implode(",",$key);
		$res = file_put_contents(ROOT_PATH.$v."_key.csv",$str);
		echo ROOT_PATH.$v."_key.csv<br>";
		if ($res) echo "success<hr>";
		else {echo "error<hr>";}
	}
	
